{include file="admin/top.php" subject='products'}
{include file="products/top.php" subject='products'}
<div id="content">

  <form method="post">
    <table width="100%" border="0" cellpadding="5" cellspacing="0" id="editor">
       <tr>
        <td class="title">产品分类:</td>
        <td class="content">
        <select name="classid" onchange="setPriceline(this.options[this.options.selectedIndex].getAttribute('priceline'),this.options[this.options.selectedIndex].getAttribute('priceunderline'))">
        <option value="0">根分类</option>
        {foreach from=$myclasses key=key item=item}
        <option value="{$item.id}" priceline="{$item.priceline}" priceunderline="{$item.priceunderline}" {if $item.id==$myclassesid}selected{/if}>
        {$item.title}
        </option>
        {if $item.children}
        {foreach from=$item.children key=sub_key item=sub_item}
         <option value="{$sub_item.id}" priceline="{$sub_item.priceline}" priceunderline="{$sub_item.priceunderline}" {if $sub_item.id==$myclassesid}selected{/if}>
        |——{$sub_item.title}
        </option>
        {/foreach}
        {/if}
        {/foreach}
        
        </select> *
        
        
        </td>
        <td class="content"> {if $errors.empty_classid}<span class="warning">请选择产品分类</span>
        {else}选择产品分类
        {/if}</td>
      </tr>
      <tr>
        <td width="100" class="title">产品名称:</td>
        <td width="240" class="content"><input name="title" type="text" id="title" value="{$smarty.post.title}" size="30" /> *</td>
        <td width="821" class="content">
        {if $errors.empty_title}<span class="warning">产品名称不能为空</span>
        {else}填写产品的名称
        {/if}        </td>
      </tr>
      <tr>
        <td class="title">产品规格:</td>
        <td class="content"><input name="spec" type="text" id="spec" value="{$smarty.post.spec}" size="30" /></td>
        <td class="content">填写产品规格, 如 50g，200ml等</td>
      </tr>
      <tr>
        <td class="title">采购单价:</td>
        <td class="content"><input name="pricebuy" type="text" id="pricebuy" value="{$smarty.post.pricebuy}" size="30" update_price=1/> *</td>
        <td class="content">{if $errors.empty_pricebuy}<span class="warning">采购单价不能为空</span>
        {else}填写采购单价
        {/if} </td>
      </tr>
      <tr>
        <td class="title">销售底价:</td>
        <td class="content" style="width:580px;"><input name="priceundersell" type="text" id="priceundersell" value="{$smarty.post.priceundersell}" size="30" update_price=1/>=采购单价×(1+销售底价底利率<input type="text" id="priceunderline" value="" size="10" update_price=1>(%))</td>
        <td class="content">{if $errors.empty_priceundersell}<span class="warning">销售底价不能为空</span>
        {else}填写销售底价
        {/if} </td>
      </tr>
      <tr>
        <td class="title">销售单价:</td>
        <td class="content"><input name="pricesell" type="text" id="pricesell" value="{$smarty.post.pricesell}" size="30" update_price=1/>=采购单价×&nbsp;&nbsp;&nbsp;(1+销售价底利率<input type="text" id="priceline" value="" size="10" update_price=1>(%))</td>
        <td class="content">{if $errors.empty_pricesell}<span class="warning">销售单价不能为空</span>
        {else}填写销售单价
        {/if} </td>
      </tr>
      <tr>
        <td class="title">库存单位:</td>
        <td class="content"><input name="unit" type="text" id="unit" value="{$smarty.post.unit}" size="30" /></td>
        <td class="content">库存计算的单位, 如: 个, 箱, 件, 斤等</td>
      </tr>
            <tr>
        <td class="title">最小出库单位:</td>
        <td class="content" style="width:580px;"><input  type="text" name="minnum" value="{$smarty.post.minnum|default:1}" size="30" /></td>
        <td class="content">设置此值后将以此最小单位出库</td>
      </tr>
      <tr>
        <td class="title">最大出库单位:</td>
        <td class="content" style="width:580px;"><input  type="text" name="maxnum" value="{$smarty.post.maxnum|default:1}" size="30" /></td>
        <td class="content">设置此值后将以此最大单位出库</td>
      </tr>
      <tr>
        <td class="title">预警数量:</td>
        <td class="content" style="width:580px;"><input  type="text" name="shopwarningnum" value="{$smarty.post.shopwarningnum|default:5}" size="30" /></td>
        <td class="content">该商品的预警数量（默认为 5），如果此商品没有具体的预警数量，则继承父类的预警数量值</td>
      </tr>
      <tr>
        <td class="title">虚拟库存:</td>
        <td class="content"><input name="canbuyout" type="text" id="canbuyout" value="{$smarty.post.canbuyout|default:0}" size="30" /> </td>
        <td class="content">允许虚拟销售的库存数，如果为负值则此商品为0不显示缺货，库存为负此值或以下时，显示缺货，如果不设置继承分类值</td>
      </tr>
      <tr class="noline">
        <td class="title">产品介绍:</td>
        <td colspan="2" class="content"><textarea name="intro" cols="100" rows="8" id="intro">{$smarty.post.intro}</textarea></td>
      </tr>
    </table>
    
    <div class="fr mt10">
    <input type="submit" value="添加" class="btn" />
    <a href="#" class="btn" onclick="history.back();">取消</a> 
    <input name="action" type="hidden" id="action" value="create" />
    </div>
  </form>
</div>
{include file="admin/bottom.php"}
</body>
</html>
